package com.singzi.testCase;

import com.singzi.leetcode.obj.TreeNode;
import javafx.scene.layout.Priority;
import org.junit.Test;

import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

public class QueueTest {
    @Test
    public void addNull(){
        TreeNode treeNode = null;
        Queue<TreeNode> queue = new LinkedList<>();

        queue.add(treeNode.right!= null?treeNode.left: null);
    }
    @Test
    public void test01() {
        Queue<TreeNode> queue = new LinkedList<>();
    }
    @Test
    public void testPriority(){
        Queue<Integer> queue = new PriorityQueue<>();
        queue.add(1);
        queue.add(1);
        queue.add(1);
        queue.add(2);
        queue.add(-1);
        while (!queue.isEmpty()){
            System.out.println(queue.remove());
//            System.out.println(remove);
//            System.out.println(queue.poll());
        }
    }
}
